CFLAGS = -D_REENTRANT
LDFLAGS = 
RMFLAGS = -f

SRCFOLDER = src/
BINFOLER = bin/
MAIN = main.h
REALMAIN = main.c
OBJMAIN = main.o
INT = init_functions.h mise_en_carton.h impression.h mise_en_palette.h stockage.h retrait.h ../utils/utils.h
TESTINT = Tests/test_runner.h Tests/mise_en_carton_test.h
REAL = $(INT:.h=.c)
OBJ = $(INT:.h=.o)
TESTREAL = $(TESTINT:.h=.c)
TESTOBJ = $(TESTINT:.h=.o)
EXE = chaineCond
TESTEXE = test_runner
EFFACE = clean
TEST = test
RM = rm
ECHO = echo
COMP = gcc
EDL = gcc
LIBS = -lpthread -lrt -lcheck
LIBTP = 


$(EXE):$(OBJMAIN) $(OBJ)
	$(ECHO) Edl de $(EXE)
	$(EDL) $(LDFLAGS) -o $(EXE) $(OBJMAIN) $(OBJ) $(LIBTP) $(LIBS)

%.o:%.cpp
	$(ECHO) compil de $<
	$(COMP) $(CCFLAGS) -c $<

$(EFFACE):
	$(RM) $(RMFLAGS) $(EXE) $(OBJMAIN) $(OBJ) $(TESTEXE) $(TESTOBJ)  corei

$(TEST):$(TESTOBJ) $(OBJ)
	$(ECHO) Edl de $(TESTEXE)
	$(EDL) $(LDFLAGS) -o $(TESTEXE) $(TESTOBJ) $(OBJ) $(LIBTP) $(LIBS)
